package cn.cnlee.app.adapter;

import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;

import java.util.List;

import cn.cnlee.app.R;
import cn.cnlee.app.base.BaseRecyclerAdapter;
import cn.cnlee.app.base.BaseViewHolder;
import cn.cnlee.app.pojo.SubscriptionDTO;

/**
 */
public class CategoryAdapter extends BaseRecyclerAdapter<SubscriptionDTO> {


    public CategoryAdapter(Context context, @Nullable List<SubscriptionDTO> list, int itemLayoutId) {
        super(context, list, itemLayoutId);
    }

    @Override
    protected void convert(BaseViewHolder holder, final SubscriptionDTO item, int position, List payloads) {
        ImageView categoryIcon = holder.getView(R.id.iv_classify);
        TextView categoryName = holder.getView(R.id.tv_classify);
        Glide.with(getContext())
                .load(item.pLogo)
                .into(categoryIcon);
        categoryName.setText(item.pName);

    }
}
